<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .center {
   height: 500px;
   width: 500px;
   background-color: pink;
   margin: auto;
}
    </style>
</head>
<body>
    <div class="center">本内容会居中</div>
</body>
</html>